<%@page import="javax.naming.InitialContext"%>
<%@page import="javax.naming.Context"%>
<%@page import="VietDQ.VietDQSessionBeanLocal"%>
<%@page import="Entity.Event"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.text.DateFormat"%>
<%
            if (session.getAttribute("Admin_Session") != null) {
                response.sendRedirect("index.jsp");
            } else {

%>
<%@page import="Entity.Account"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>National Level Paper Presentation</title>

<link href="templatemo_style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/calendar-eightysix-v1.1-default.css" media="screen" />
<script type="text/javascript" src="js/mootools-1.2.4-core.js"></script>
<script type="text/javascript" src="js/mootools-1.2.4.4-more.js"></script>
<script type="text/javascript" src="js/calendar-eightysix-v1.1.js"></script>-->
<script type="text/javascript">
    $.noConflict();
</script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/piroBox.1_2.js"></script>
<script type="text/javascript" src="js/jquery.validate.min.js"></script>
<script type="text/javascript">
    $.noConflict();
</script>
<script type="text/javascript">
jQuery(document).ready(function($) {
    new CalendarEightysix('exampleI', { 'offsetY': -4 });
  });
</script>
</head>
<body>
    <!-----------------------------header--------------------------------------->
<div id="templatemo_header_wrapper">
    <jsp:include page="header.jsp" flush="true"/>

</div>
<!-------------------------------- end header ---------------------------------->

<!--------------------------------- menu ------------------------>
<div id="templatemo_menu_wrapper">
    <div id="templatemo_menu">

        <ul>
            <li><a href="index.jsp">Home</a></li>
            <li><a href="VietDQServlet?action=UserGetAllEvents">Events</a></li>
<%
    if(session.getAttribute("User_Session")!=null){
        Account ac = (Account)session.getAttribute("User_Session");
%>
            <li><a href="PhuocPHServlet?action=UViewFB&User_Session=<%= ac.getUsername() %>">Feedback</a></li>
<%
            }
%>
            <li><a href="AboutUS.jsp">About Us</a></li>
            <li><a href="VietDQServlet?action=ViewFAQ">FAQ</a></li>
        </ul>

    </div>
</div>
<!---------------------------------end  menu ------------------------>

<!--------------------------------- Content ------------------------>
<div id="templatemo_content_wrapper">

	<div id="templatemo_sidebar">
                    <div class="sidebar_box">
            <h2>Login</h2>
            <form action="LoginServlet" method="post">
                <table>
                    <tr>
                    <td><label>Username: </label></td>
                    <td><input type="text" value="" name="txtUsername" id="input_field" /></td>
                    </tr>
                    <tr>
                    <td><label>Password: </label></td>
                    <td><input type="password" value="" name="txtPassword" id="input_field" /></td>
                    </tr>
                    <tr>
                     <td></td>
                        <td><input type="submit" name="action" value="Sign In" class="Button"/></td>
                    </tr>
                </table>
             <%

                     if(session.getAttribute("Invalid")!=null)
                                  {
                                %>
                                <label style="color: red"><%=session.getAttribute("Invalid").toString() %></label>
                                <%

                            }%>
                            <a href="Register.jsp">Sign Up</a>
                <br/>
               <a href="Forgot1.jsp">Forgot Password ?</a>
            </form>
            <div class="cleaner"></div>
        
       </div><div class="sidebar_box_bottom"></div>

    	<div class="sidebar_box">
 <jsp:include flush="true" page="TopnewEvents.jsp"></jsp:include>
        </div><div class="sidebar_box_bottom"></div>

    </div>

    <div id="templatemo_content">

    	<div class="content_box">

            <h2>Register Account Form</h2>
            <form action="RegisterAccountServlet" method="post" enctype="multipart/form-data" id="Register">
<%
                if(session.getAttribute("Session_Register")!=null)
                    {
%>
            <label style="color: red"><%=session.getAttribute("Session_Register").toString() %></label>
<%
        }
%>
                <table>
                    <tr>
                        <td align="right">Username: </td>
                        <td align="left"><input type="text" name="txtUser" value="" class="inputt"/>(<span class="style1">*</span>)<br/>
                        <label for="txtUser" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right">Password: </td>
                        <td align="left"><input type="password" name="txtPass" value="" class="inputt" id="txtPass"/>(<span class="style1">*</span>)<br/>
                        <label for="txtPass" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right">Confirm Password: </td>
                        <td align="left"><input type="password" name="txtCfPass" value="" class="inputt" id="txtCfPass"/>(<span class="style1">*</span>)<br/>
                        <label for="txtCfPass" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right">Fullname: </td>
                        <td align="left"><input type="text" name="txtFull" value="" class="inputt"/>(<span class="style1">*</span>)<br/>
                        <label for="txtFull" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right">Email: </td>
                        <td align="left"><input type="text" name="txtEmail" value="" class="inputt"/>(<span class="style1">*</span>)<br/>
                        <label for="txtEmail" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right">Gender: </td>
                        <td align="left"><input name="gender" type="radio" value="0" checked/> Male
                                         <input name="gender" type="radio" value="1"/> Female
                        </td>
                    </tr>
                    <tr>
                        <td align="right" valign="top">Address: </td>
                        <td align="left"><textarea name="txtAdd"></textarea>(<span class="style1">*</span>)<br/>
                        <label for="txtAdd" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right">Phone: </td>
                        <td align="left"><input type="text" name="txtPhone" value="" class="inputt"/>(<span class="style1">*</span>)<br/>
                        <label for="txtPhone" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right">School: </td>
                        <td align="left"><input type="text" name="txtSchool" value="" class="inputt"/>(<span class="style1">*</span>)<br/>
                        <label for="txtSchool" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right">Birthday: </td>
                        <td align="left"><input id="exampleI" name="dateI" type="text" maxlength="10" />(<span class="style1">*</span>)<br/>
                        <label for="txtBirthday" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right">Avatar: </td>
                        <td align="left"><input type="file" name="fileAvatar" accept="fileupload/*" size="25"/>(<span class="style1">*</span>)<br/>
                        <label for="fileAvatar" generated="true" class="error"></label></td>
                    </tr>
                    <tr>
                        <td align="right"></td>
                        <td align="left"><input type="submit" name="action" value="SignUp" class="Button"/>
                            <input type="reset" name="action" value="Reset" class="Button"/>
                        </td>
                    </tr>
                </table>
            </form>
<script type="text/javascript">
    jQuery(document).ready(function($) {
           $("#Register").validate({
             messages: {
                 txtUser: {
                     required: "Username is required",
                     rangelength: "Username must be from 8 to 13 characters"
                 },
                 txtPass: {
                     required: "Password is required",
                     rangelength: "Password must be 6 to 20 characters"
                 },
                 txtCfPass: {
                     required: "Password Confirm is required",
                     equalTo: "Please enter the same value with Password",
                     rangelength: "Password Confirm must be 6 to 20 characters"
                 },
                 txtFull: {
                     required: "Full Name is required",
                     rangelength: "Full Name must be from 5 to 30 characters"
                 },
                  txtPhone: {
                     required: "Phone is required",
                     digits:"Please enter only Number" ,
                     rangelength: "Phone must be from 9 to 11 characters"
                 },
                 txtEmail: {
                     required: "Email is required",
                     rangelength: "Email must be from 5 to 50 characters",
                     email:"Please input valid email"
                 },
                 txtAdd:{
                     required: "Address is required",
                     rangelength: "Address must be from 5 to 50 characters"
                 },
                 txtSchool:{
                     required: "School is required",
                     rangelength: "School must be from 5 to 50 characters"
                 },
                 fileAvatar: {
                     required: "Please choose a Avatar",
                     accept:"Avatar only accept file jpg,png,gif"
                 }
            },
            rules: {
                txtUser: {
                    required: true,
                    rangelength: [8, 13]
                 },
                txtPass: {
                    required: true,
                    rangelength: [6, 20]
                },
                txtCfPass: {
                    required: true,
                    equalTo: "#txtPass",
                    rangelength: [6, 20]
                },
                txtFull: {
                    required: true,
                    rangelength: [5, 30]
                },
                 txtPhone: {
                    required: true,
                    digits: true,
                    rangelength: [9, 11]
                },
                txtEmail: {
                    required: true,
                    rangelength: [5, 50],
                    email: true
                },
                txtAdd:{
                    required: true,
                    rangelength: [5, 50]
                },
                txtSchool:{
                    required: true,
                    rangelength: [5, 50]
                },
                fileAvatar: {
                    required: true,
                    accept:'jpg|gif|png'
                }
            }
        });
    });
         $(".cancel").click(function() {
		validator.resetForm();
	});

 </script>
        	<div class="cleaner"></div>
        </div>

    </div>

    <div class="cleaner"></div>

</div>

<!---------------------------------End Content ------------------------>

<div id="templatemo_footer_wrapper">

    <jsp:include page="footer.jsp" flush="true"/>

</div>
</body>
</html>
<%
}
%>